﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms;

namespace SARControlLib
{
	/// <summary>
	/// SARFileDialog.xaml 的交互逻辑
	/// </summary>
	public partial class SARFileDialog : System.Windows.Controls.UserControl
	{
        private OpenFileDialog dialog = new OpenFileDialog();
        public OpenFileDialog Dialog
        {
            get { return dialog; }
            set { dialog = value; }
        }

		public SARFileDialog()
		{
			this.InitializeComponent();
            //new OpenFileDialog().ShowDialog();
		}

        private void Btn_Click(object sender, RoutedEventArgs e)
        {
            dialog.ShowDialog();
            this.FilePath2.Text = dialog.FileName;

        }

        public static void OnMyFilePathChanged(DependencyObject ob,DependencyPropertyChangedEventArgs e)
        {
            int i = 1;
            
            //FilePath = e.NewValue.ToString();
            
            

        }
        public static DependencyProperty FilePath =
            DependencyProperty.Register("MyFilePath", typeof(string), typeof(SARFileDialog) ,
            new FrameworkPropertyMetadata(null,
                new PropertyChangedCallback(OnMyFilePathChanged)));


        
	}
}